Login     Sign up
User rating stars
adil (@adil)
Join date: May 9th 2010
Community posts: 202
View Profile
Send Message

many of my members are asking for a member rating stars

I think you got the point but let me explain

  1. the member of larger library of blogs gets star for every 20 blogs
  2. the popular member of larger no of friends get star for every 50 friends
  3. the member of other activities like adding music or videos get star for every 20 or 30 addings

or what ever the mean of rating and the star are placed under his/her photo in his/her profile !!! one rule ... no avatar no rating...
can some one build such a mod and place it on the new directory please

Adil

167 months ago
Sebastian (@fashawn)
Join date: Aug 31st 2010
Community posts: 17
View Profile
Send Message

Hi adil,

i thing i maybe got something for you in mind =)
I will try the next days to add a point system module for JCow.

The admin can decide what action on your network will give certain points and the user can level up. These points and level are displayed in the user profile and the user gets some sort of badges or awards. Like posting 50 comments, uploading a certain number of photos etc..

Just a small addition i kept in mind from working with an other community script ;)

Greetings
Sebastian

167 months ago
jade (@jadem)
Join date: Sep 1st 2010
Community posts: 14
View Profile
Send Message

please.... I need the kind of module you mentioned ( point system/awarding points) my members will love that feature. This point system is available in ELGG and Buddypress so it must be also nice to have it in JCOW

167 months ago
Jumanji (@jumanji)
Join date: Sep 1st 2010
Community posts: 27
View Profile
Send Message

@fashawn that sounds great mate!

167 months ago
adil (@adil)
Join date: May 9th 2010
Community posts: 202
View Profile
Send Message

any ideas yet

165 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

sombody knows something about this code ? there is also a votes table on database.is a about a rating pics system, but i dont know where to activate this?
i change var $allow_vote = 1; in story.inc and uncomment code rating (its commented ¡¡) , i have in js all files od straarting and css, but nothing changes in the website.

this is the file i am speaking about:

[url]http://www.phpkode.com/source/p/jcow-sns/includes/libs/story.inc.php[/url]
and the same code is in modules/photos

[code]
if ($this->allow_vote && strlen($row['rating']) > 10) {
if ($client['id']) {
$res = sql_query("select * from ".tb()."votes where uid='{$client['id']}' and sid='{$sid}' limit 1");
if (sql_counts($res)) {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
else {
$vote_button = '<input type="button" style="font-size:10px" value="'.t('Submit').'" id="sendrate" />';
$vote_disable = '';
}
}
else {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
$story .= '<div id="rating_box">
<script src="'.uhome().'/js/starrating/jquery.MetaData.js" type="text/javascript" language="javascript"></script>
<script src="'.uhome().'/js/starrating/jquery.rating.js" type="text/javascript" language="javascript"></script>
<link href="'.uhome().'/js/starrating/jquery.rating.css" type="text/css" rel="stylesheet"/>
<form id="starrate">
<table border="0">
<td>';
$ratings = unserialize($row['rating']);
if (!is_array($ratings)) $ratings = array();
foreach ($ratings as $key=>$rating) {
$ratecheck = array();
if ($rating['users']) {
$rate = ceil($rating['score']/$rating['users']);
}
else {
$rate = 0;
}
$ratecheck[$rate] = 'checked';
$story .= '
<div style="width:100%;clear:both">'.$this->vote_options[$key].'</div>
<div style="width:100%;clear:both">
<input type="radio" class="star {split:2}" name="'.$key.'" value="1" '.$ratecheck['1'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="2" '.$ratecheck['2'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="3" '.$ratecheck['3'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="4" '.$ratecheck['4'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="5" '.$ratecheck['5'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="6" '.$ratecheck['6'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="7"/ '.$ratecheck['7'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="8"/ '.$ratecheck['8'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="9"/ '.$ratecheck['9'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="10"/ '.$ratecheck['10'].' >
</div>
';
}
$story .= '
</td>
<td>
<span id="sendbox">'.$vote_button.'</span>
<span id="votesnum" class="sub">'.$row['dugg'].'</span> <span class="sub">vote(s)</span>
</td>
</table>
<script>
$(document).ready( function(){
'.$vote_disable.'
$("#sendrate").click(function() {
$("#sendbox").html("<img src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
$("input").rating("readOnly",true);
$.post("'.$uhome.'/index.php?p=jquery/ratestory",{
rate:$("form#starrate").serialize(),
sid:$("#story_id").val()},
function(data) {
$("#sendbox").html("sent");
$("#votesnum").html(data);
},\'html\');
return false;

                        });
                    });
                    </script>
            ';
            $story .= '</div>';
        }

        if (is_array($this->story_opts)) {
            $story .= '<script>
                $(document).ready( function(){
                    $("#add_to_favorite").click(function() {
                        $("#add_to_favorite").replaceWith("<img id=\'add_to_favorite\' src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
                        $.post("'.$uhome.'/index.php?p=jquery/favoriteadd",{sid:$("#story_id").val()},function(data) {
                            $("#add_to_favorite").replaceWith(data);
                        },\'html\');
                    });
            });
            </script>
            <table border="0"><tr>';
            $story .= '</tr></table>';
        }

[/code]

160 months ago
adil (@adil)
Join date: May 9th 2010
Community posts: 202
View Profile
Send Message

I think the code you are talking about is an old code from star system jcow haded very long time agoooo

160 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

ok, it s done, i have activated the rating code starring, it works on albums (not pics) and blog posts.
Seems to be cool at the moment... wondering why it was "hidden"

160 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

Any chance of enlightening us on how you activated it mate..

160 months ago
1
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

it s easy, just change from 0 to 1
in includes/story.inc
$allow_vote = 1
in modules/photos
$this->allow_vote = 1;
and uncomment voting code in
modules/photos ( delete / / )
From :

[code]
if ($this->allow_vote && strlen($row['rating']) > 10) {
if ($client['id']) {
$res = sql_query("select * from ".tb()."votes where uid='{$client['id']}' and sid='{$sid}' limit 1");
if (sql_counts($res)) {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
else {
$vote_button = '<input type="button" style="font-size:10px" value="'.t('Submit').'" id="sendrate" />';
$vote_disable = '';
}
}
else {
$vote_button = '';
$vote_disable = '$("input").rating("readOnly",true);';
}
$story .= '<div id="rating_box">
<script src="'.uhome().'/js/starrating/jquery.MetaData.js" type="text/javascript" language="javascript"></script>
<script src="'.uhome().'/js/starrating/jquery.rating.js" type="text/javascript" language="javascript"></script>
<link href="'.uhome().'/js/starrating/jquery.rating.css" type="text/css" rel="stylesheet"/>
<form id="starrate">
<table border="0">
<td>';
$ratings = unserialize($row['rating']);
if (!is_array($ratings)) $ratings = array();
foreach ($ratings as $key=>$rating) {
$ratecheck = array();
if ($rating['users']) {
$rate = ceil($rating['score']/$rating['users']);
}
else {
$rate = 0;
}
$ratecheck[$rate] = 'checked';
$story .= '
<div style="width:100%;clear:both">'.$this->vote_options[$key].'</div>
<div style="width:100%;clear:both">
<input type="radio" class="star {split:2}" name="'.$key.'" value="1" '.$ratecheck['1'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="2" '.$ratecheck['2'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="3" '.$ratecheck['3'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="4" '.$ratecheck['4'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="5" '.$ratecheck['5'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="6" '.$ratecheck['6'].' />
<input type="radio" class="star {split:2}" name="'.$key.'" value="7"/ '.$ratecheck['7'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="8"/ '.$ratecheck['8'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="9"/ '.$ratecheck['9'].' >
<input type="radio" class="star {split:2}" name="'.$key.'" value="10"/ '.$ratecheck['10'].' >
</div>
';
}
$story .= '
</td>
<td>
<span id="sendbox">'.$vote_button.'</span>
<span id="votesnum" class="sub">'.$row['dugg'].'</span> <span class="sub">vote(s)</span>
</td>
</table>
<script>
$(document).ready( function(){
'.$vote_disable.'
$("#sendrate").click(function() {
$("#sendbox").html("<img src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
$("input").rating("readOnly",true);
$.post("'.$uhome.'/index.php?p=jquery/ratestory",{
rate:$("form#starrate").serialize(),
sid:$("#story_id").val()},
function(data) {
$("#sendbox").html("sent");
$("#votesnum").html(data);
},\'html\');
return false;

});
});
</script>
';
$story .= '</div>';
}

if (is_array($this->story_opts)) {
$story .= '<script>
$(document).ready( function(){
$("#add_to_favorite").click(function() {
$("#add_to_favorite").replaceWith("<img id=\'add_to_favorite\' src=\''.$uhome.'/files/loading.gif\' width=16 height=16 />");
$.post("'.$uhome.'/index.php?p=jquery/favoriteadd",{sid:$("#story_id").val()},function(data) {
$("#add_to_favorite").replaceWith(data);
},\'html\');
});
});
</script>
<table border="0"><tr>';
$story .= '</tr></table>';
}
[/code]

that s all

you will see a rating satrs for albums, but [b] just new ones added after making the chnages[/b] , so you need to add an album for test. old album will not have this rating option.

160 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

lol cheers mate that was to easy.

its abit of a ugly rater isnt it :( and it really isnt any use where it is ..

160 months ago
Eliz zeta (@eliz)
Join date: Nov 29th 2010
Community posts: 153
View Profile
Send Message

its also on blogs and events

160 months ago